package com.matt.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.matt.commons.model.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * 育儿百科
 */
@Entity
@Data
@Table(name = "parenting_encyclopedia")
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class ParentingEncyclopedia extends Model {
    @Column(columnDefinition = " varchar(32) COMMENT '园区id'")
    private String areaId;

    @Column(columnDefinition = " varchar(1000) COMMENT '标题'")
    private String title;

    @Column(columnDefinition = " int DEFAULT 1 COMMENT '所属阶段 0:孕前 1:0-1岁 2:1-2岁 3:2-3岁'")
    private Integer belongingStage;

    @Column(columnDefinition = " varchar(1000) COMMENT '图片,多个用,分隔'")
    private String photo;

    @Column(columnDefinition = " varchar(1000) COMMENT '视频，多个用，分隔'")
    private String video;

    @Column(columnDefinition = " int  DEFAULT 2 COMMENT '1上线 2 下线 默认2'")
    private Integer showStatus;

    @Column(columnDefinition = " bigint(20)  DEFAULT 0 COMMENT '观看次数'")
    private Long viewsNumber;

    @Column(columnDefinition = " varchar(32)  COMMENT '评论人id'")
    private String userId;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone="GMT+8")
    @Column(columnDefinition = " datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间'")
    private Date createTime;

    @Column(columnDefinition = " int DEFAULT 0  COMMENT '是否删除   0:未删除  1:已删除'")
    private Integer deleted;


}
